# 拷贝日志
rm -rf /home/dev/log/*
service_name=$(kubectl -n ${ns} get pods | grep ${service} | awk '{print $1}')
echo $service_name
kubectl cp -n  ${ns} $service_name:log/ ./log
ds=$(date -d today +"%Y-%m-%d_%H%M%S")
tar -zcv -f zjh_$ds.tar.gz ./log
sz zjh_$ds.tar.gz\r

# 查看日志
service_name=$(kubectl -n ${ns} get pods | grep ${service} | awk '{print $1}')
kubectl -n ${ns} logs -f --tail=100 $service_name -c ${service} \r